const { resolve } = require("path");

var pro =new Promise(function(resovle,reject){
    if(flase){
        resovle('success');
    }else{
        reject('failed');
    }
});
pro.then(function(param){
    console.log(param);
},function(param){
    console.log(param);
})

function fn1(sec){
    window.setTimeout(function(){
        console.log('我是函数一');

    },sec *1000);
}
function fn2(sec){
    window.setTimeout(function(){
        console.log('我是函数二');
       
    },sec *1000);
}
function fn3(sec){
    window.setTimeout(function(){
        console.log('我是函数三');
        resolve();
    },sec *1000);
}

fn1(3).then(function(){
    return fn2(1);
}).then(function(){
    return fn3(2);
});